<!--
To change this template, choose Tools | Templates
and open the template in the editor.
-->
<!DOCTYPE html>
<html>
	<head>
		<title></title>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<script type="text/javascript" src="http://cdnjs.cloudflare.com/ajax/libs/jquery/1.8.0/jquery-1.8.0.min.js"></script>
		<script type="text/javascript" src="http://underscorejs.org/underscore.js"></script>
		<script type="text/javascript" src="http://cdnjs.cloudflare.com/ajax/libs/backbone.js/0.9.2/backbone-min.js"></script>
	</head>
	<body>
		<h1> Test </h1>
		<div id="posts_container"></div>
		
	
<script type="text/template" id="post-template">
    <div style="width:100%; display:inline-block;">
		<img src="http://localhost:8080/seednia-webapp/media/image/<% if(typeof creatorProfileImageSid != 'undefined') { print(creatorProfileImageSid); }%>/profile.jpg?w=40" style="float:left; padding:5px">
		<a class="delete">[Delete]</a>
		<div style="margin-right:50px"><b><%= creatorDisplayName %></b>
			@ <a href="http://localhost/seednia-uiphp-nb/index.php/Project/<%= projectSid %>"><%= projectName %></a><br />
			<%= body %>
			
			<blockquote>
				<?php echo $comment->body %>
			</blockquote>
			<div>
				<a href="#">Comment</a> | <%= createDt %>
				<form class="quick-form" name="CommentForm" action="http://localhost/seednia-uiphp-nb/index.php/Post/addcomment" method="post"><input type="hidden" id="targetSid" name="targetSid" value="<%= sid ?>" /><input id="body" name="body" /></form>
			</div>
		</div>
	</div>
</script>
<script type="text/javascript" src="public/js/seednia.post.js"></script>
	
<script type="text/javascript">
(function ($) {
 
var posts = new seednia.PostCollection([
	{ "sid": 1, body: "This is a nice test", creatorDisplayName: "TIno Suk Ahn", createDt: "2012/1/3", creatorProfileImageSid : 58, projectSid: 11, projectName:"Seednia" },
	{ sid: 2, body: "This is a nice test1", creatorDisplayName: "Young Suk Ahn", createDt: "2012/1/3", creatorProfileImageSid : 58, projectSid: 11, projectName:"Test Goal" },
	{ sid: 3, body: "This is a nice test2", creatorDisplayName: "Young Suk Ahn", createDt: "2012/1/3", creatorProfileImageSid : 58, projectSid: 11, projectName:"Best" }
], { projectSid : 1 });
 

var postListView = new seednia.PostListView({ 
	collection:  posts
});
posts.fetch({
  success : function(collection) {
	  console.log(arguments);
    $('#posts_container').html(postListView.render());
  },
  error: function() { console.log(arguments); }
});

} (jQuery));



</script>
	</body>
</html>
